home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 2 / Meeting Pearls Vol. II (1995)(GTI - Schatztruhe)[!].iso / Pearls / dev / GUI / BGUI / include / libraries / bgui_macros.h next >
Encoding:
C/C++ Source or Header  |  1994-09-09  |  31.8 KB  |  933 lines

  1. #ifndef LIBRARIES_BGUI_MACROS_H
  2. #define LIBRARIES_BGUI_MACROS_H
  3. /*
  4. **      $VER: libraries/bgui_macros.h 37.26 (09.09.94)
  5. **      bgui.library macros.
  6. **
  7. **      (C) Copyright 1993-1994 Jaba Development.
  8. **      (C) Copyright 1993-1994 Jan van den Baard.
  9. **      All Rights Reserved.
  10. **/
  11.  
  12. #ifndef LIBRARIES_BGUI_H
  13. #include "bgui.h"
  14. #endif /* LIBRARIES_BGUI_H */
  15.  
  16. /*****************************************************************************
  17.  *
  18.  *      General object creation macros.
  19.  */
  20. #define HGroupObject            BGUI_NewObject( BGUI_GROUP_GADGET
  21. #define VGroupObject            BGUI_NewObject( BGUI_GROUP_GADGET,\
  22.                                                 GROUP_Style, GRSTYLE_VERTICAL
  23. #define ButtonObject            BGUI_NewObject( BGUI_BUTTON_GADGET
  24. #define ToggleObject            BGUI_NewObject( BGUI_BUTTON_GADGET,\
  25.                                                 GA_ToggleSelect, TRUE
  26. #define CycleObject             BGUI_NewObject( BGUI_CYCLE_GADGET
  27. #define CheckBoxObject          BGUI_NewObject( BGUI_CHECKBOX_GADGET
  28. #define InfoObject              BGUI_NewObject( BGUI_INFO_GADGET
  29. #define StringObject            BGUI_NewObject( BGUI_STRING_GADGET
  30. #define PropObject              BGUI_NewObject( BGUI_PROP_GADGET
  31. #define IndicatorObject         BGUI_NewObject( BGUI_INDICATOR_GADGET
  32. #define ProgressObject          BGUI_NewObject( BGUI_PROGRESS_GADGET
  33. #define SliderObject            BGUI_NewObject( BGUI_SLIDER_GADGET
  34. #define PageObject              BGUI_NewObject( BGUI_PAGE_GADGET
  35. #define MxObject                BGUI_NewObject( BGUI_MX_GADGET
  36. #define ListviewObject          BGUI_NewObject( BGUI_LISTVIEW_GADGET
  37. #define ExternalObject          BGUI_NewObject( BGUI_EXTERNAL_GADGET, GA_Left, 0, GA_Top, 0, GA_Width, 0, GA_Height, 0
  38. #define SeperatorObject         BGUI_NewObject( BGUI_SEPERATOR_GADGET
  39.  
  40. #define WindowObject            BGUI_NewObject( BGUI_WINDOW_OBJECT
  41. #define FileReqObject           BGUI_NewObject( BGUI_FILEREQ_OBJECT
  42. #define CommodityObject         BGUI_NewObject( BGUI_COMMODITY_OBJECT
  43.  
  44. #define EndObject               TAG_END )
  45.  
  46. /*****************************************************************************
  47.  *
  48.  *      Label creation.
  49.  */
  50. #define Label(l)                LAB_Label, l
  51. #define UScoreLabel(l,u)        LAB_Label, l, LAB_Underscore, u
  52. #define Style(s)                LAB_Style, s
  53. #define Place(p)                LAB_Place, p
  54.  
  55. /*****************************************************************************
  56.  *
  57.  *      Frames.
  58.  */
  59. #define ButtonFrame             FRM_Type, FRTYPE_BUTTON
  60. #define RidgeFrame              FRM_Type, FRTYPE_RIDGE
  61. #define DropBoxFrame            FRM_Type, FRTYPE_DROPBOX
  62. #define NeXTFrame               FRM_Type, FRTYPE_NEXT
  63. #define RadioFrame              FRM_Type, FRTYPE_RADIOBUTTON
  64. #define XenFrame                FRM_Type, FRTYPE_XEN_BUTTON
  65.  
  66. /* For clarity. */
  67. #define StringFrame             RidgeFrame
  68. #define MxFrame                 RadioFrame
  69.  
  70. #define FrameTitle(t)           FRM_Title, t
  71.  
  72. /* Built-in back fills */
  73. #define ShineRaster             FRM_BackFill, SHINE_RASTER
  74. #define ShadowRaster            FRM_BackFill, SHADOW_RASTER
  75. #define ShineShadowRaster       FRM_BackFill, SHINE_SHADOW_RASTER
  76. #define FillRaster              FRM_BackFill, FILL_RASTER
  77. #define ShineFillRaster         FRM_BackFill, SHINE_FILL_RASTER
  78. #define ShadowFillRaster        FRM_BackFill, SHADOW_FILL_RASTER
  79. #define ShineBlock              FRM_BackFill, SHINE_BLOCK
  80. #define ShadowBlock             FRM_BackFill, SHADOW_BLOCK
  81.  
  82. /*****************************************************************************
  83.  *
  84.  *      Vector images.
  85.  */
  86. #define GetPath                 VIT_BuiltIn, BUILTIN_GETPATH
  87. #define GetFile                 VIT_BuiltIn, BUILTIN_GETFILE
  88. #define CheckMark               VIT_BuiltIn, BUILTIN_CHECKMARK
  89. #define PopUp                   VIT_BuiltIn, BUILTIN_POPUP
  90. #define ArrowUp                 VIT_BuiltIn, BUILTIN_ARROW_UP
  91. #define ArrowDown               VIT_BuiltIn, BUILTIN_ARROW_DOWN
  92. #define ArrowLeft               VIT_BuiltIn, BUILTIN_ARROW_LEFT
  93. #define ArrowRight              VIT_BuiltIn, BUILTIN_ARROW_RIGHT
  94.  
  95. /*****************************************************************************
  96.  *
  97.  *      Group class macros.
  98.  */
  99. #define StartMember             GROUP_Member
  100. #define EndMember               TAG_END, 0
  101. #define Spacing(p)              GROUP_Spacing, p
  102. #define HOffset(p)              GROUP_HorizOffset, p
  103. #define VOffset(p)              GROUP_VertOffset, p
  104. #define LOffset(p)              GROUP_LeftOffset, p
  105. #define ROffset(p)              GROUP_RightOffset, p
  106. #define TOffset(p)              GROUP_TopOffset, p
  107. #define BOffset(p)              GROUP_BottomOffset, p
  108. #define VarSpace(w)             GROUP_SpaceObject, w
  109.  
  110. /*****************************************************************************
  111.  *
  112.  *      Layout macros.
  113.  */
  114. #define FixMinWidth             LGO_FixMinWidth, TRUE
  115. #define FixMinHeight            LGO_FixMinHeight, TRUE
  116. #define Weight(w)               LGO_Weight, w
  117. #define FixWidth(w)             LGO_FixWidth, w
  118. #define FixHeight(h)            LGO_FixHeight, h
  119. #define Align                   LGO_Align, TRUE
  120. #define FixMinSize              FixMinWidth, FixMinHeight
  121. #define FixSize(w,h)            FixWidth(w), FixHeight(h)
  122.  
  123. /*****************************************************************************
  124.  *
  125.  *      Page class macros.
  126.  */
  127. #define PageMember              PAGE_Member
  128.  
  129. /*****************************************************************************
  130.  *
  131.  *      "Quick" button creation macros.
  132.  */
  133. #define Button(label,id)\
  134.         ButtonObject,\
  135.                 LAB_Label,              label,\
  136.                 GA_ID,                  id,\
  137.                 ButtonFrame,\
  138.         EndObject
  139.  
  140. #define KeyButton(label,id)\
  141.         ButtonObject,\
  142.                 LAB_Label,              label,\
  143.                 LAB_Underscore,         '_',\
  144.                 GA_ID,                  id,\
  145.                 ButtonFrame,\
  146.         EndObject
  147.  
  148. #define Toggle(label,state,id)\
  149.         ToggleObject,\
  150.                 LAB_Label,              label,\
  151.                 GA_ID,                  id,\
  152.                 GA_Selected,            state,\
  153.                 ButtonFrame,\
  154.         EndObject
  155.  
  156. #define KeyToggle(label,state,id)\
  157.         ToggleObject,\
  158.                 LAB_Label,              label,\
  159.                 LAB_Underscore,         '_',\
  160.                 GA_ID,                  id,\
  161.                 GA_Selected,            state,\
  162.                 ButtonFrame,\
  163.         EndObject
  164.  
  165. #define XenButton(label,id)\
  166.         ButtonObject,\
  167.                 LAB_Label,              label,\
  168.                 GA_ID,                  id,\
  169.                 XenFrame,\
  170.         EndObject
  171.  
  172. #define XenKeyButton(label,id)\
  173.         ButtonObject,\
  174.                 LAB_Label,              label,\
  175.                 LAB_Underscore,         '_',\
  176.                 GA_ID,                  id,\
  177.                 XenFrame,\
  178.         EndObject
  179.  
  180. #define XenToggle(label,state,id)\
  181.         ToggleObject,\
  182.                 LAB_Label,              label,\
  183.                 GA_ID,                  id,\
  184.                 GA_Selected,            state,\
  185.                 XenFrame,\
  186.         EndObject
  187.  
  188. #define XenKeyToggle(label,state,id)\
  189.         ToggleObject,\
  190.                 LAB_Label,              label,\
  191.                 LAB_Underscore,         '_',\
  192.                 GA_ID,                  id,\
  193.                 GA_Selected,            state,\
  194.                 XenFrame,\
  195.         EndObject
  196.  
  197. /*****************************************************************************
  198.  *
  199.  *      "Quick" cycle creation macros.
  200.  */
  201. #define Cycle(label,labels,active,id)\
  202.         CycleObject,\
  203.                 LAB_Label,              label,\
  204.                 GA_ID,                  id,\
  205.                 ButtonFrame,\
  206.                 CYC_Labels,             labels,\
  207.                 CYC_Active,             active,\
  208.         EndObject
  209.  
  210. #define KeyCycle(label,labels,active,id)\
  211.         CycleObject,\
  212.                 LAB_Label,              label,\
  213.                 LAB_Underscore,         '_',\
  214.                 GA_ID,                  id,\
  215.                 ButtonFrame,\
  216.                 CYC_Labels,             labels,\
  217.                 CYC_Active,             active,\
  218.         EndObject
  219.  
  220. #define XenCycle(label,labels,active,id)\
  221.         CycleObject,\
  222.                 LAB_Label,              label,\
  223.                 GA_ID,                  id,\
  224.                 XenFrame,\
  225.                 CYC_Labels,             labels,\
  226.                 CYC_Active,             active,\
  227.         EndObject
  228.  
  229. #define XenKeyCycle(label,labels,active,id)\
  230.         CycleObject,\
  231.                 LAB_Label,              label,\
  232.                 LAB_Underscore,         '_',\
  233.                 GA_ID,                  id,\
  234.                 XenFrame,\
  235.                 CYC_Labels,             labels,\
  236.                 CYC_Active,             active,\
  237.         EndObject
  238.  
  239. #define PopCycle(label,labels,active,id)\
  240.         CycleObject,\
  241.                 LAB_Label,              label,\
  242.                 GA_ID,                  id,\
  243.                 ButtonFrame,\
  244.                 CYC_Labels,             labels,\
  245.                 CYC_Active,             active,\
  246.                 CYC_Popup,              TRUE,\
  247.         EndObject
  248.  
  249. #define KeyPopCycle(label,labels,active,id)\
  250.         CycleObject,\
  251.                 LAB_Label,              label,\
  252.                 LAB_Underscore,         '_',\
  253.                 GA_ID,                  id,\
  254.                 ButtonFrame,\
  255.                 CYC_Labels,             labels,\
  256.                 CYC_Active,             active,\
  257.                 CYC_Popup,              TRUE,\
  258.         EndObject
  259.  
  260. #define XenPopCycle(label,labels,active,id)\
  261.         CycleObject,\
  262.                 LAB_Label,              label,\
  263.                 GA_ID,                  id,\
  264.                 XenFrame,\
  265.                 CYC_Labels,             labels,\
  266.                 CYC_Active,             active,\
  267.                 CYC_Popup,              TRUE,\
  268.         EndObject
  269.  
  270. #define XenKeyPopCycle(label,labels,active,id)\
  271.         CycleObject,\
  272.                 LAB_Label,              label,\
  273.                 LAB_Underscore,         '_',\
  274.                 GA_ID,                  id,\
  275.                 XenFrame,\
  276.                 CYC_Labels,             labels,\
  277.                 CYC_Active,             active,\
  278.                 CYC_Popup,              TRUE,\
  279.         EndObject
  280.  
  281. /*****************************************************************************
  282.  *
  283.  *      "Quick" checkbox creation macros.
  284.  */
  285. #define CheckBox(label,state,id)\
  286.         CheckBoxObject,\
  287.                 LAB_Label,              label,\
  288.                 GA_ID,                  id,\
  289.                 ButtonFrame,\
  290.                 FRM_Flags,              FRF_EDGES_ONLY,\
  291.                 GA_Selected,            state,\
  292.         EndObject, FixMinSize
  293.  
  294. #define KeyCheckBox(label,state,id)\
  295.         CheckBoxObject,\
  296.                 LAB_Label,              label,\
  297.                 LAB_Underscore,         '_',\
  298.                 GA_ID,                  id,\
  299.                 ButtonFrame,\
  300.                 FRM_Flags,              FRF_EDGES_ONLY,\
  301.                 GA_Selected,            state,\
  302.         EndObject, FixMinSize
  303.  
  304. #define XenCheckBox(label,state,id)\
  305.         CheckBoxObject,\
  306.                 LAB_Label,              label,\
  307.                 GA_ID,                  id,\
  308.                 XenFrame,\
  309.                 FRM_Flags,              FRF_EDGES_ONLY,\
  310.                 GA_Selected,            state,\
  311.         EndObject, FixMinSize
  312.  
  313. #define XenKeyCheckBox(label,state,id)\
  314.         CheckBoxObject,\
  315.                 LAB_Label,              label,\
  316.                 LAB_Underscore,         '_',\
  317.                 GA_ID,                  id,\
  318.                 XenFrame,\
  319.                 FRM_Flags,              FRF_EDGES_ONLY,\
  320.                 GA_Selected,            state,\
  321.         EndObject, FixMinSize
  322.  
  323. #define CheckBoxNF(label,state,id)\
  324.         CheckBoxObject,\
  325.                 LAB_Label,              label,\
  326.                 GA_ID,                  id,\
  327.                 ButtonFrame,\
  328.                 FRM_Flags,              FRF_EDGES_ONLY,\
  329.                 GA_Selected,            state,\
  330.         EndObject,
  331.  
  332. #define KeyCheckBoxNF(label,state,id)\
  333.         CheckBoxObject,\
  334.                 LAB_Label,              label,\
  335.                 LAB_Underscore,         '_',\
  336.                 GA_ID,                  id,\
  337.                 ButtonFrame,\
  338.                 FRM_Flags,              FRF_EDGES_ONLY,\
  339.                 GA_Selected,            state,\
  340.         EndObject,
  341.  
  342. #define XenCheckBoxNF(label,state,id)\
  343.         CheckBoxObject,\
  344.                 LAB_Label,              label,\
  345.                 GA_ID,                  id,\
  346.                 XenFrame,\
  347.                 FRM_Flags,              FRF_EDGES_ONLY,\
  348.                 GA_Selected,            state,\
  349.         EndObject,
  350.  
  351. #define XenKeyCheckBoxNF(label,state,id)\
  352.         CheckBoxObject,\
  353.                 LAB_Label,              label,\
  354.                 LAB_Underscore,         '_',\
  355.                 GA_ID,                  id,\
  356.                 XenFrame,\
  357.                 FRM_Flags,              FRF_EDGES_ONLY,\
  358.                 GA_Selected,            state,\
  359.         EndObject,
  360.  
  361. /*****************************************************************************
  362.  *
  363.  *      "Quick" info object creation macros.
  364.  */
  365. #define InfoFixed(label,text,args,numlines)\
  366.         InfoObject,\
  367.                 LAB_Label,              label,\
  368.                 ButtonFrame,\
  369.                 FRM_Flags,              FRF_RECESSED,\
  370.                 INFO_TextFormat,        text,\
  371.                 INFO_Args,              args,\
  372.                 INFO_MinLines,          numlines,\
  373.                 INFO_FixTextWidth,      TRUE,\
  374.         EndObject
  375.  
  376. #define InfoObj(label,text,args,numlines)\
  377.         InfoObject,\
  378.                 LAB_Label,              label,\
  379.                 ButtonFrame,\
  380.                 FRM_Flags,              FRF_RECESSED,\
  381.                 INFO_TextFormat,        text,\
  382.                 INFO_Args,              args,\
  383.                 INFO_MinLines,          numlines,\
  384.         EndObject
  385.  
  386. /*****************************************************************************
  387.  *
  388.  *      "Quick" string/integer creation macros.
  389.  */
  390. #define String(label,contents,maxchars,id)\
  391.         StringObject,\
  392.                 LAB_Label,              label,\
  393.                 RidgeFrame,\
  394.                 STRINGA_TextVal,        contents,\
  395.                 STRINGA_MaxChars,       maxchars,\
  396.                 GA_ID,                  id,\
  397.         EndObject
  398.  
  399. #define KeyString(label,contents,maxchars,id)\
  400.         StringObject,\
  401.                 LAB_Label,              label,\
  402.                 LAB_Underscore,         '_',\
  403.                 RidgeFrame,\
  404.                 STRINGA_TextVal,        contents,\
  405.                 STRINGA_MaxChars,       maxchars,\
  406.                 GA_ID,                  id,\
  407.         EndObject
  408.  
  409. #define TabString(label,contents,maxchars,id)\
  410.         StringObject,\
  411.                 LAB_Label,              label,\
  412.                 RidgeFrame,\
  413.                 STRINGA_TextVal,        contents,\
  414.                 STRINGA_MaxChars,       maxchars,\
  415.                 GA_ID,                  id,\
  416.                 GA_TabCycle,            TRUE,\
  417.         EndObject
  418.  
  419. #define TabKeyString(label,contents,maxchars,id)\
  420.         StringObject,\
  421.                 LAB_Label,              label,\
  422.                 LAB_Underscore,         '_',\
  423.                 RidgeFrame,\
  424.                 STRINGA_TextVal,        contents,\
  425.                 STRINGA_MaxChars,       maxchars,\
  426.                 GA_ID,                  id,\
  427.                 GA_TabCycle,            TRUE,\
  428.         EndObject
  429.  
  430. #define Integer(label,contents,maxchars,id)\
  431.         StringObject,\
  432.                 LAB_Label,              label,\
  433.                 RidgeFrame,\
  434.                 STRINGA_LongVal,        contents,\
  435.                 STRINGA_MaxChars,       maxchars,\
  436.                 GA_ID,                  id,\
  437.         EndObject
  438.  
  439. #define KeyInteger(label,contents,maxchars,id)\
  440.         StringObject,\
  441.                 LAB_Label,              label,\
  442.                 LAB_Underscore,         '_',\
  443.                 RidgeFrame,\
  444.                 STRINGA_LongVal,        contents,\
  445.                 STRINGA_MaxChars,       maxchars,\
  446.                 GA_ID,                  id,\
  447.         EndObject
  448.  
  449. #define TabInteger(label,contents,maxchars,id)\
  450.         StringObject,\
  451.                 LAB_Label,              label,\
  452.                 RidgeFrame,\
  453.                 STRINGA_LongVal,        contents,\
  454.                 STRINGA_MaxChars,       maxchars,\
  455.                 GA_ID,                  id,\
  456.                 GA_TabCycle,            TRUE,\
  457.         EndObject
  458.  
  459. #define TabKeyInteger(label,contents,maxchars,id)\
  460.         StringObject,\
  461.                 LAB_Label,              label,\
  462.                 LAB_Underscore,         '_',\
  463.                 RidgeFrame,\
  464.                 STRINGA_LongVal,        contents,\
  465.                 STRINGA_MaxChars,       maxchars,\
  466.                 GA_ID,                  id,\
  467.                 GA_TabCycle,            TRUE,\
  468.         EndObject
  469.  
  470. /*
  471.  *      STRINGA_Pens & STRINGA_ActivePens pen-pack macro.
  472.  */
  473. #define PACKPENS(a,b) (((b<<8)&0xFF00)|((a)&0x00FF))
  474.  
  475. /*****************************************************************************
  476.  *
  477.  *      "Quick" scroller creation macros.
  478.  */
  479. #define HorizScroller(label,top,total,visible,id)\
  480.         PropObject,\
  481.                 LAB_Label,              label,\
  482.                 PGA_Top,                top,\
  483.                 PGA_Total,              total,\
  484.                 PGA_Visible,            visible,\
  485.                 PGA_Freedom,            FREEHORIZ,\
  486.                 GA_ID,                  id,\
  487.                 PGA_Arrows,             TRUE,\
  488.         EndObject
  489.  
  490. #define VertScroller(label,top,total,visible,id)\
  491.         PropObject,\
  492.                 LAB_Label,              label,\
  493.                 PGA_Top,                top,\
  494.                 PGA_Total,              total,\
  495.                 PGA_Visible,            visible,\
  496.                 GA_ID,                  id,\
  497.                 PGA_Arrows,             TRUE,\
  498.         EndObject
  499.  
  500. #define KeyHorizScroller(label,top,total,visible,id)\
  501.         PropObject,\
  502.                 LAB_Label,              label,\
  503.                 LAB_Underscore,         '_',\
  504.                 PGA_Top,                top,\
  505.                 PGA_Total,              total,\
  506.                 PGA_Visible,            visible,\
  507.                 PGA_Freedom,            FREEHORIZ,\
  508.                 GA_ID,                  id,\
  509.                 PGA_Arrows,             TRUE,\
  510.         EndObject
  511.  
  512. #define KeyVertScroller(label,top,total,visible,id)\
  513.         PropObject,\
  514.                 LAB_Label,              label,\
  515.                 LAB_Underscore,         '_',\
  516.                 PGA_Top,                top,\
  517.                 PGA_Total,              total,\
  518.                 PGA_Visible,            visible,\
  519.                 GA_ID,                  id,\
  520.                 PGA_Arrows,             TRUE,\
  521.         EndObject
  522.  
  523. /*****************************************************************************
  524.  *
  525.  *      "Quick" indicator creation macros.
  526.  */
  527. #define Indicator(min,max,level,just)\
  528.         IndicatorObject,\
  529.                 INDIC_Min,              min,\
  530.                 INDIC_Max,              max,\
  531.                 INDIC_Level,            level,\
  532.                 INDIC_Justification,    just,\
  533.         EndObject
  534.  
  535. #define IndicatorFormat(min,max,level,just,format)\
  536.         IndicatorObject,\
  537.                 INDIC_Min,              min,\
  538.                 INDIC_Max,              max,\
  539.                 INDIC_Level,            level,\
  540.                 INDIC_Justification,    just,\
  541.                 INDIC_FormatString,     format,\
  542.         EndObject
  543.  
  544. /*****************************************************************************
  545.  *
  546.  *      "Quick" progress creation macros.
  547.  */
  548. #define HorizProgress(label,min,max,done)\
  549.         ProgressObject,\
  550.                 LAB_Label,              label,\
  551.                 ButtonFrame,\
  552.                 FRM_Flags,              FRF_RECESSED,\
  553.                 PROGRESS_Min,           min,\
  554.                 PROGRESS_Max,           max,\
  555.                 PROGRESS_Done,          done,\
  556.         EndObject
  557.  
  558. #define VertProgress(label,min,max,done)\
  559.         ProgressObject,\
  560.                 LAB_Label,              label,\
  561.                 ButtonFrame,\
  562.                 FRM_Flags,              FRF_RECESSED,\
  563.                 PROGRESS_Min,           min,\
  564.                 PROGRESS_Max,           max,\
  565.                 PROGRESS_Done,          done,\
  566.                 PROGRESS_Vertical,      TRUE,\
  567.         EndObject
  568.  
  569. /*****************************************************************************
  570.  *
  571.  *      "Quick" slider creation macros.
  572.  */
  573. #define HorizSlider(label,min,max,level,id)\
  574.         SliderObject,\
  575.                 LAB_Label,              label,\
  576.                 SLIDER_Min,             min,\
  577.                 SLIDER_Max,             max,\
  578.                 SLIDER_Level,           level,\
  579.                 GA_ID,                  id,\
  580.         EndObject
  581.  
  582. #define VertSlider(label,min,max,level,id)\
  583.         SliderObject,\
  584.                 LAB_Label,              label,\
  585.                 SLIDER_Min,             min,\
  586.                 SLIDER_Max,             max,\
  587.                 SLIDER_Level,           level,\
  588.                 PGA_Freedom,            FREEVERT,\
  589.                 GA_ID,                  id,\
  590.         EndObject
  591.  
  592. #define KeyHorizSlider(label,min,max,level,id)\
  593.         SliderObject,\
  594.                 LAB_Label,              label,\
  595.                 LAB_Underscore,         '_',\
  596.                 SLIDER_Min,             min,\
  597.                 SLIDER_Max,             max,\
  598.                 SLIDER_Level,           level,\
  599.                 GA_ID,                  id,\
  600.         EndObject
  601.  
  602. #define KeyVertSlider(label,min,max,level,id)\
  603.         SliderObject,\
  604.                 LAB_Label,              label,\
  605.                 LAB_Underscore,         '_',\
  606.                 SLIDER_Min,             min,\
  607.                 SLIDER_Max,             max,\
  608.                 SLIDER_Level,           level,\
  609.                 PGA_Freedom,            FREEVERT,\
  610.                 GA_ID,                  id,\
  611.         EndObject
  612.  
  613. /*****************************************************************************
  614.  *
  615.  *      "Quick" mx creation macros.
  616.  */
  617. #define RightMx(label,labels,active,id)\
  618.         MxObject,\
  619.                 GROUP_Style,            GRSTYLE_VERTICAL,\
  620.                 LAB_Label,              label,\
  621.                 MX_Labels,              labels,\
  622.                 MX_Active,              active,\
  623.                 GA_ID,                  id,\
  624.         EndObject, FixMinSize
  625.  
  626. #define LeftMx(label,labels,active,id)\
  627.         MxObject,\
  628.                 GROUP_Style,            GRSTYLE_VERTICAL,\
  629.                 LAB_Label,              label,\
  630.                 MX_Labels,              labels,\
  631.                 MX_Active,              active,\
  632.                 MX_LabelPlace,          PLACE_LEFT,\
  633.                 GA_ID,                  id,\
  634.         EndObject, FixMinSize
  635.  
  636. #define RightMxKey(label,labels,active,id)\
  637.         MxObject,\
  638.                 GROUP_Style,            GRSTYLE_VERTICAL,\
  639.                 LAB_Label,              label,\
  640.                 LAB_Underscore,         '_',\
  641.                 MX_Labels,              labels,\
  642.                 MX_Active,              active,\
  643.                 GA_ID,                  id,\
  644.         EndObject, FixMinSize
  645.  
  646. #define LeftMxKey(label,labels,active,id)\
  647.         MxObject,\
  648.                 GROUP_Style,            GRSTYLE_VERTICAL,\
  649.                 LAB_Label,              label,\
  650.                 LAB_Underscore,         '_',\
  651.                 MX_Labels,              labels,\
  652.                 MX_Active,              active,\
  653.                 MX_LabelPlace,          PLACE_LEFT,\
  654.                 GA_ID,                  id,\
  655.         EndObject, FixMinSize
  656.  
  657. /*****************************************************************************
  658.  *
  659.  *      "Quick" listview creation macros.
  660.  */
  661. #define StrListview(label,strings,id)\
  662.         ListviewObject,\
  663.                 LAB_Label,              label,\
  664.                 GA_ID,                  id,\
  665.                 LISTV_EntryArray,       strings,\
  666.         EndObject
  667.  
  668. #define StrListviewSorted(label,strings,id)\
  669.         ListviewObject,\
  670.                 LAB_Label,              label,\
  671.                 GA_ID,                  id,\
  672.                 LISTV_EntryArray,       strings,\
  673.                 LISTV_SortEntryArray,   TRUE,\
  674.         EndObject
  675.  
  676. #define ReadStrListview(label,strings)\
  677.         ListviewObject,\
  678.                 LAB_Label,              label,\
  679.                 LISTV_EntryArray,       strings,\
  680.                 LISTV_ReadOnly,         TRUE,\
  681.         EndObject
  682.  
  683. #define ReadStrListviewSorted(label,strings)\
  684.         ListviewObject,\
  685.                 LAB_Label,              label,\
  686.                 LISTV_EntryArray,       strings,\
  687.                 LISTV_SortEntryArray,   TRUE,\
  688.                 LISTV_ReadOnly,         TRUE,\
  689.         EndObject
  690.  
  691. #define MultiStrListview(label,strings,id)\
  692.         ListviewObject,\
  693.                 LAB_Label,              label,\
  694.                 GA_ID,                  id,\
  695.                 LISTV_EntryArray,       strings,\
  696.                 LISTV_MultiSelect,      TRUE,\
  697.         EndObject
  698.  
  699. #define MultiStrListviewSorted(label,strings,id)\
  700.         ListviewObject,\
  701.                 LAB_Label,              label,\
  702.                 GA_ID,                  id,\
  703.                 LISTV_EntryArray,       strings,\
  704.                 LISTV_SortEntryArray,   TRUE,\
  705.                 LISTV_MultiSelect,      TRUE,\
  706.         EndObject
  707.  
  708. /*****************************************************************************
  709.  *
  710.  *      "Quick" seperator bar creation macros.
  711.  */
  712. #define VertSeperator\
  713.         SeperatorObject,\
  714.         EndObject, FixMinWidth
  715.  
  716. #define VertThinSeperator\
  717.         SeperatorObject,\
  718.                 SEP_Thin,               TRUE,\
  719.         EndObject, FixMinWidth
  720.  
  721. #define HorizSeperator\
  722.         SeperatorObject,\
  723.                 SEP_Horiz,              TRUE,\
  724.         EndObject, FixMinHeight
  725.  
  726. #define TitleSeperator(t)\
  727.         SeperatorObject,\
  728.                 SEP_Horiz,              TRUE,\
  729.                 SEP_Title,              t,\
  730.         EndObject, FixMinHeight
  731.  
  732. #define HTitleSeperator(t)\
  733.         SeperatorObject,\
  734.                 SEP_Horiz,              TRUE,\
  735.                 SEP_Title,              t,\
  736.                 SEP_Highlight,          TRUE,\
  737.         EndObject, FixMinHeight
  738.  
  739. #define CTitleSeperator(t)\
  740.         SeperatorObject,\
  741.                 SEP_Horiz,              TRUE,\
  742.                 SEP_Title,              t,\
  743.                 SEP_CenterTitle,        TRUE,\
  744.         EndObject, FixMinHeight
  745.  
  746. #define CHTitleSeperator(t)\
  747.         SeperatorObject,\
  748.                 SEP_Horiz,              TRUE,\
  749.                 SEP_Title,              t,\
  750.                 SEP_Highlight,          TRUE,\
  751.                 SEP_CenterTitle,        TRUE,\
  752.         EndObject, FixMinHeight
  753.  
  754. /*****************************************************************************
  755.  *
  756.  *      Some simple menu macros.
  757.  */
  758. #define Title(t)\
  759.         { NM_TITLE, t, NULL, 0, 0, NULL }
  760. #define Item(t,s,i)\
  761.         { NM_ITEM, t, s, 0, 0, (APTR)i }
  762. #define ItemBar\
  763.         { NM_ITEM, NM_BARLABEL, NULL, 0, 0, NULL }
  764. #define SubItem(t,s,i)\
  765.         { NM_SUB, t, s, 0, 0, (APTR)i }
  766. #define SubBar\
  767.         { NM_SUB, NM_BARLABEL, NULL, 0, 0, NULL }
  768. #define End\
  769.         { NM_END, NULL, NULL, 0, 0, NULL }
  770.  
  771. /*****************************************************************************
  772.  *
  773.  *      Base class method macros.
  774.  */
  775. #define AddMap(object,target,map)\
  776.         DoMethod( object, BASE_ADDMAP, target, map )
  777.  
  778. #define AddCondit(object,target,ttag,tdat,ftag,fdat,stag,sdat)\
  779.         DoMethod( object, BASE_ADDCONDITIONAL, target,\
  780.                   ttag, tdat,\
  781.                   ftag, fdat,\
  782.                   stag, sdat )
  783.  
  784. #define AddHook(object,hook)\
  785.         DoMethod( object, BASE_ADDHOOK, hook )
  786.  
  787. #define RemMap(object,target)\
  788.         DoMethod( object, BASE_REMMAP, target )
  789.  
  790. #define RemCondit(object,target)\
  791.         DoMethod( object, BASE_REMCONDITIONAL, target )
  792.  
  793. #define RemHook( object,hook)\
  794.         DoMethod( object, BASE_REMHOOK, hook )
  795.  
  796. /*****************************************************************************
  797.  *
  798.  *      Listview class method macros.
  799.  */
  800. #define AddEntry(window,object,entry,how)\
  801.         BGUI_DoGadgetMethod( object, window, NULL, LVM_ADDSINGLE,\
  802.                              NULL, entry, how, 0L )
  803.  
  804. #define AddEntryVisible(window,object,entry,how)\
  805.         BGUI_DoGadgetMethod( object, window, NULL, LVM_ADDSINGLE,\
  806.                              NULL, entry, how, LVASF_MAKEVISIBLE )
  807.  
  808. #define AddEntrySelect(window,object,entry,how)\
  809.         BGUI_DoGadgetMethod( object, window, NULL, LVM_ADDSINGLE,\
  810.                              NULL, entry, how, LVASF_SELECT )
  811.  
  812. #define ClearList(window,object)\
  813.         BGUI_DoGadgetMethod( object, window, NULL, LVM_CLEAR, NULL )
  814.  
  815. #define FirstEntry(object)\
  816.         DoMethod( object, LVM_FIRSTENTRY, NULL, 0L )
  817.  
  818. #define FirstSelected(object)\
  819.         DoMethod( object, LVM_FIRSTENTRY, NULL, LVGEF_SELECTED )
  820.  
  821. #define LastEntry(object)\
  822.         DoMethod( object, LVM_LASTENTRY, NULL, 0L )
  823.  
  824. #define LastSelected(object)\
  825.         DoMethod( object, LVM_LASTENTRY, NULL, LVGEF_SELECTED )
  826.  
  827. #define NextEntry(object,last)\
  828.         DoMethod( object, LVM_NEXTENTRY, last, 0L )
  829.  
  830. #define NextSelected(object,last)\
  831.         DoMethod( object, LVM_NEXTENTRY, last, LVGEF_SELECTED )
  832.  
  833. #define PrevEntry(object,last)\
  834.         DoMethod( object, LVM_PREVENTRY, last, 0L )
  835.  
  836. #define PrevSelected(object,last)\
  837.         DoMethod( object, LVM_PREVENTRY, last, LVGEF_SELECTED )
  838.  
  839. #define RemoveEntry(object,entry)\
  840.         DoMethod( object, LVM_REMENTRY, NULL, entry )
  841.  
  842. #define RemoveEntryVisible(window,object,entry)\
  843.         BGUI_DoGadgetMethod( object, window, NULL, LVM_REMENTRY, NULL, entry )
  844.  
  845. #define RefreshList(window,object)\
  846.         BGUI_DoGadgetMethod( object, window, NULL, LVM_REFRESH, NULL )
  847.  
  848. #define SortList(window,object)\
  849.         BGUI_DoGadgetMethod( object, window, NULL, LVM_SORT, NULL )
  850.  
  851. #define LockList(object)\
  852.         DoMethod( object, LVM_LOCKLIST, NULL )
  853.  
  854. #define UnlockList(window,object)\
  855.         BGUI_DoGadgetMethod( object, window, NULL, LVM_UNLOCKLIST, NULL )
  856.  
  857. /*****************************************************************************
  858.  *
  859.  *      Window class method macros.
  860.  */
  861. #define GadgetKey(wobj,gobj,key)\
  862.         DoMethod( wobj, WM_GADGETKEY, NULL, gobj, key )
  863.  
  864. #define WindowOpen(wobj)\
  865.         ( struct Window * )DoMethod( wobj, WM_OPEN )
  866.  
  867. #define WindowClose(wobj)\
  868.         DoMethod( wobj, WM_CLOSE )
  869.  
  870. #define WindowBusy(wobj)\
  871.         DoMethod( wobj, WM_SLEEP )
  872.  
  873. #define WindowReady(wobj)\
  874.         DoMethod( wobj, WM_WAKEUP )
  875.  
  876. #define HandleEvent(wobj)\
  877.         DoMethod( wobj, WM_HANDLEIDCMP )
  878.  
  879. #define DisableMenu(wobj,id,set)\
  880.         DoMethod( wobj, WM_DISABLEMENU, id, set )
  881.  
  882. #define CheckItem(wobj,id,set)\
  883.         DoMethod( wobj, WM_CHECKITEM, id, set )
  884.  
  885. #define MenuDisabled(wobj,id)\
  886.         DoMethod( wobj, WM_MENUDISABLED, id )
  887.  
  888. #define ItemChecked(wobj,id)\
  889.         DoMethod( wobj, WM_ITEMCHECKED, id )
  890.  
  891. #define GetAppMsg(wobj)\
  892.         ( struct AppMessage * )DoMethod( wobj, WM_GETAPPMSG )
  893.  
  894. #define AddUpdate(wobj,id,target,map)\
  895.         DoMethod( wobj, WM_ADDUPDATE, id, target, map )
  896.  
  897. /*****************************************************************************
  898.  *
  899.  *      Commodity class method macros.
  900.  */
  901. #define AddHotkey(broker,desc,id,flags)\
  902.         DoMethod( broker, CM_ADDHOTKEY, desc, id, flags )
  903.  
  904. #define RemHotkey(broker,id)\
  905.         DoMethod( broker, CM_REMHOTKEY, id )
  906.  
  907. #define DisableHotkey(broker,id)\
  908.         DoMethod( broker, CM_DISABLEHOTKEY, id )
  909.  
  910. #define EnableHotKey(broker,id)\
  911.         DoMethod( broker, CM_ENABLEHOTKEY, id )
  912.  
  913. #define EnableBroker(broker)\
  914.         DoMethod( broker, CM_ENABLEBROKER )
  915.  
  916. #define DisableBroker(broker)\
  917.         DoMethod( broker, CM_DISABLEBROKER )
  918.  
  919. #define MsgInfo(broker,type,id,data)\
  920.         DoMethod( broker, CM_MSGINFO,\
  921.                   ( ULONG * )type,\
  922.                   ( ULONG * )id,\
  923.                   ( ULONG * )data )
  924.  
  925. /*****************************************************************************
  926.  *
  927.  *      FileReq class method macros.
  928.  */
  929. #define DoRequest(object)\
  930.         DoMethod( object, FRM_DOREQUEST )
  931.  
  932. #endif /* LIBRARIES_BGUI_MACROS_H */
  933.